#!/bin/bash

#函数 参数为$1 $2 ...
funCreate(){
	#echo "$1 $2 $3 $4"
	echo "insert into table1(id, name, age, create_time) values('$1','$2',$3,$4);" >>1.sql
}
array_name=("张1" "张2" "张3" "张4" "张5" "张6" "张7" "张8" "张9" "张10")

#清空文件
cat /dev/null >1.sql
i=1
while((i<=1000000))
do
	UUID=$(cat /proc/sys/kernel/random/uuid) #uuid 生成
	age=$[RANDOM%100+1] #1-100的随机数
	name=${array_name[RANDOM%10]} #数组随机遍历
	create_time=$(date "+%Y%m%d%H%M%S") #当前时间格式
	funCreate $UUID $name $age $create_time
	let i++
done